<?php
	require('feedback.doc.php');
	//建议
	$app->post(
		'/feedback/add',
		function() use($app, $db2){
			$data = $app->request()->post();
			$echo['error'] = "";
			if($data && isset($data['phone']) && isset($data['content']) && isset($data['userid']) && isset($data['usertype'])){
				$db2->insert('tb_feedback', array(
					'phone' => $data['phone'],
					'content' => urldecode($data['content']),
					'userid' => $data['userid'],
					'usertype' => $data['usertype'],
					'dt' => date('Y-m-d H:i:s')
				));
			}else{
				$echo['error'] = "数据缺失，请检查";
			}
			echo json_encode($echo);
		}
	);
?>